<template>
  <!-- 检查不合格/  复查合格/不合格--PDF页面 -->
  <div class="inspectPdf">
    <div class="pdf-btn" @click="htmlToPdf" v-if="crmBook == 'all'">下载</div>
    <div class="back-btn" @click="$router.back()" v-if="crmBook == 'all'">返回</div>

    <div class="matterList page" v-if="crmBook == 'all'">
      <div class="right-title">{{ policeCheckTaskInfo.policeAgencyName }}</div>

      <div class="recordTable">
        <div class="nameTitle">{{ policeCheckTaskInfo.companyMessageName }}检查记录单</div>

        <div
          class="details-table detailModal"
          :class="params.checkType == 1 && params.checkResult == 2 ? 'detailHeight' : ''"
        >
          <div class="common-titlepdf">
            <div class="icon"></div>
            <div class="content">企业信息</div>
          </div>
          <div class="stepTable">
            <div class="actualUnitDetails">
              <div class="companyinfo">
                <table>
                  <tr>
                    <td class="td_title" colspan="1">单位名称</td>
                    <td class="padNone" colspan="1">{{ policeCheckTaskInfo.companyMessageName || '暂无' }}</td>
                    <td class="td_title" colspan="1">所属行业</td>
                    <td class="padNone" colspan="1">{{ policeCheckTaskInfo.industryInformationName || '暂无' }}</td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">统一社会信用代码</td>
                    <td class="padNone" colspan="1">{{ policeCheckTaskInfo.companyCreditCode || '暂无' }}</td>
                    <td class="td_title" colspan="1">责任民警</td>
                    <td class="padNone" colspan="1">{{ policeCheckTaskInfo.companyPoliceUserName || '暂无' }}</td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">企业法人</td>
                    <td class="padNone" colspan="1">{{ policeCheckTaskInfo.companyLegalPersonName || '暂无' }}</td>
                    <td class="td_title" colspan="1">法人联系方式</td>
                    <td class="padNone" colspan="1">{{ policeCheckTaskInfo.companyLegalMobile || '暂无' }}</td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">营业地址</td>
                    <td class="padNone" colspan="5">{{ policeCheckTaskInfo.companyAddressDetail || '暂无' }}</td>
                  </tr>
                </table>
              </div>
            </div>
          </div>

          <!-- 检查信息 -->
          <div class="common-titlepdf">
            <div class="icon"></div>
            <div class="content">检查信息</div>
          </div>
          <div class="stepTable">
            <div class="actualUnitDetails">
              <div class="companyinfo">
                <table>
                  <tr>
                    <td class="td_title" colspan="1">检查民警</td>
                    <td class="padNone" colspan="1">{{ policeCheckTaskInfo.policeUserName || '暂无' }}</td>
                    <td class="td_title" rowspan="6" colspan="1">民警签到图</td>
                    <td rowspan="6" width="340">
                      <img :src="`${imgPrefix + policeCheckTaskInfo.signPicture}`" alt="" class="signImage cusImg" />
                    </td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">警号</td>
                    <td class="padNone" colspan="1">{{ policeCheckTaskInfo.policeUserNo || '暂无' }}</td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">辅警</td>
                    <td class="padNone" colspan="1">
                      {{ policeCheckTaskInfo.policeCheckTaskAuxiliaryInfoList[0].policeUserName || '暂无' }}
                    </td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">检查类型</td>
                    <td class="padNone" colspan="1">{{ policeCheckTaskInfo.industryExamineName || '暂无' }}</td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">检查/复查</td>
                    <td class="padNone" colspan="1">
                      {{ policeCheckTaskInfo.checkType == 1 ? '检查' : '复查' || '暂无' }}
                    </td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">检查时间</td>
                    <td class="padNone" colspan="1">{{ policeCheckTaskInfo.checkTime || '暂无' }}</td>
                  </tr>
                </table>

                <!-- 循环  start -->
                <table v-for="item2 in policeCheckCategoryInfoList" :key="item2.id">
                  <table v-for="itemNext in item2.policeCheckDetailInfoList" :key="item2.id + itemNext.sortOrder">
                    <tr>
                      <td class="td_title redWrite" colspan="1">不合格项{{ itemNext.frontNum }}</td>
                      <td class="padNone" colspan="5">{{ itemNext.industryExamineDetailName || '暂无' }}</td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">所属分类</td>
                      <td class="padNone" colspan="5">{{ item2.industryExamineCategoryName || '暂无' }}</td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">法律依据</td>
                      <td class="padNone" colspan="5">
                        <block v-for="(regInfo, index) in itemNext.regulationsInfoList" :key="index">
                          <div>《{{ regInfo.regulationsName }}》-{{ regInfo.regulationsArticleNo }}</div>
                          <div v-html="regInfo.regulationsArticleContent"></div>
                        </block>
                      </td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">文字证据</td>
                      <td class="padNone" colspan="5">{{ itemNext.checkMemo || '暂无' }}</td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">图片证据</td>
                      <td class="padNone" colspan="5" style="padding: 15px">
                        <block v-for="failedimg in itemNext.failedImageInfoList" :key="failedimg.path">
                          <img :src="`${imgPrefix + failedimg.path}`" alt="" class="proofImg cusImg" />
                        </block>
                        <!-- <div v-if="!itemNext.failedImageInfoList.length" class="proofImg"></div> -->
                        <div
                          v-if="itemNext.failedImageInfoList == null || !itemNext.failedImageInfoList.length"
                          class="proofImg"
                        ></div>
                      </td>
                    </tr>
                  </table>
                </table>
                <!-- 循环  end  -->

                <table>
                  <tr>
                    <td class="td_title" colspan="1">检查结果</td>
                    <td class="padNone" colspan="1">{{ policeCheckTaskInfo.checkResultName || '暂无' }}</td>
                    <td class="td_title" rowspan="3" colspan="1">责任人签名</td>
                    <td rowspan="3" width="340">
                      <img
                        :src="`${imgPrefix + policeCheckTaskInfo.principalSignatureUrl}`"
                        alt=""
                        style="width: 190px; height: 100px"
                      />
                    </td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">处罚结果</td>
                    <td class="padNone" colspan="1">
                      {{ policeCheckUnqualifiedInfo.rectificationTypeName || '暂无' }}
                    </td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">企业回执截止日期</td>
                    <td class="padNone" colspan="1">{{ policeCheckUnqualifiedInfo.penaltyEndTime || '暂无' }}</td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">电子文书</td>
                    <td class="padNone" colspan="5">见附件1</td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">回执提交时间</td>
                    <td class="padNone" colspan="1">{{ policeCheckUnqualifiedInfo.receiptTime || '暂无' }}</td>
                    <td class="td_title" colspan="1">回执是否逾期</td>
                    <td class="padNone" colspan="1">
                      {{ policeCheckUnqualifiedInfo.isReceiptOverdue == 1 ? '是' : '否' || '暂无' }}
                    </td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">回执图片</td>
                    <td class="padNone" colspan="5" style="padding: 15px">
                      <block v-for="item in policeCheckUnqualifiedInfo.receiptImageInfoList" :key="item.path">
                        <img :src="`${imgPrefix + item.path}`" alt="" class="proofImg cusImg" />
                      </block>
                      <div
                        v-if="
                          JSON.stringify(policeCheckUnqualifiedInfo) == '{}' ||
                          !policeCheckUnqualifiedInfo.receiptImageInfoList.length
                        "
                        class="proofImg"
                      ></div>
                    </td>
                  </tr>
                  <tr>
                    <td class="td_title" colspan="1">回执文字</td>
                    <td class="padNone" colspan="5">{{ policeCheckUnqualifiedInfo.receiptContent || '暂无' }}</td>
                  </tr>
                </table>
              </div>
            </div>
          </div>

          <block v-if="params.checkType != 1">
            <!-- 复查信息 -->
            <!-- <div class="printDiv" style="height: 200px"></div> -->
            <div class="common-titlepdf">
              <div class="icon"></div>
              <div class="content">复查信息</div>
            </div>

            <!-- 复查信息 （不合格） -->
            <div class="stepTable" v-if="params.checkResult == 2">
              <div class="actualUnitDetails">
                <div class="companyinfo">
                  <table>
                    <tr>
                      <td class="td_title" colspan="1">复查民警</td>
                      <td class="padNone" colspan="1">{{ policeCheckTaskInfoReview.policeUserName || '暂无' }}</td>
                      <td class="td_title" rowspan="5" colspan="1">民警签到图</td>
                      <td rowspan="5" width="340">
                        <img
                          :src="`${imgPrefix + policeCheckTaskInfoReview.signPicture}`"
                          alt=""
                          class="signImage cusImg"
                        />
                      </td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">警号</td>
                      <td class="padNone" colspan="1">{{ policeCheckTaskInfoReview.policeUserNo || '暂无' }}</td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">复查类型</td>
                      <td class="padNone" colspan="1">{{ policeCheckTaskInfoReview.industryExamineName || '暂无' }}</td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">检查/复查</td>
                      <td class="padNone" colspan="1">
                        {{ policeCheckTaskInfoReview.checkType == 1 ? '检查' : '复查' || '暂无' }}
                      </td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">复查时间</td>
                      <td class="padNone" colspan="1">{{ policeCheckTaskInfoReview.checkTime || '暂无' }}</td>
                    </tr>
                  </table>

                  <!-- 循环  start -->
                  <table v-for="item2 in policeCheckCategoryInfoListReview" :key="item2.id">
                    <table v-for="itemNext in item2.policeCheckDetailInfoList" :key="item2.id + itemNext.sortOrder">
                      <tr>
                        <td class="td_title redWrite" colspan="1">不合格项{{ itemNext.frontNum }}</td>
                        <td class="padNone" colspan="5">{{ itemNext.industryExamineDetailName || '暂无' }}</td>
                      </tr>
                      <tr>
                        <td class="td_title" colspan="1">所属分类</td>
                        <td class="padNone" colspan="5">{{ item2.industryExamineCategoryName || '暂无' }}</td>
                      </tr>
                      <tr>
                        <td class="td_title" colspan="1">法律依据</td>
                        <td class="padNone" colspan="5">
                          <block v-for="(regInfo, index) in itemNext.regulationsInfoList" :key="index">
                            <div>《{{ regInfo.regulationsName }}》-{{ regInfo.regulationsArticleNo }}</div>
                            <div v-html="regInfo.regulationsArticleContent"></div>
                          </block>
                        </td>
                      </tr>
                      <tr>
                        <td class="td_title" colspan="1">文字证据</td>
                        <td class="padNone" colspan="5">{{ itemNext.checkMemo || '暂无' }}</td>
                      </tr>
                      <tr>
                        <td class="td_title" colspan="1">图片证据</td>
                        <td class="padNone" colspan="5" style="padding: 15px">
                          <block v-for="failedimg in itemNext.failedImageInfoList" :key="failedimg.path">
                            <img :src="`${imgPrefix + failedimg.path}`" alt="" class="proofImg cusImg" />
                          </block>

                          <div
                            v-if="itemNext.failedImageInfoList == null || !itemNext.failedImageInfoList.length"
                            class="proofImg"
                          ></div>
                        </td>
                      </tr>
                    </table>
                  </table>
                  <!-- 循环  end  -->

                  <table>
                    <tr>
                      <td class="td_title" colspan="1">复查结果</td>
                      <td class="padNone" colspan="1">{{ policeCheckTaskInfoReview.checkResultName || '暂无' }}</td>
                      <td class="td_title" rowspan="3" colspan="1">责任人签名</td>
                      <td rowspan="3" width="340">
                        <img
                          :src="`${imgPrefix + policeCheckTaskInfoReview.principalSignatureUrl}`"
                          alt=""
                          style="width: 190px; height: 100px"
                        />
                      </td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">处罚结果</td>
                      <td class="padNone" colspan="1">
                        {{ policeCheckUnqualifiedInfoReview.rectificationTypeName || '暂无' }}
                      </td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">企业回执截止日期</td>
                      <td class="padNone" colspan="1">
                        {{ policeCheckUnqualifiedInfoReview.penaltyEndTime || '暂无' }}
                      </td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">电子文书</td>
                      <td class="padNone" colspan="5">见附件2</td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">回执提交时间</td>
                      <td class="padNone" colspan="1">{{ policeCheckUnqualifiedInfoReview.receiptTime || '暂无' }}</td>
                      <td class="td_title" colspan="1">回执是否逾期</td>
                      <td class="padNone" colspan="1">
                        {{ policeCheckUnqualifiedInfoReview.isReceipt == 1 ? '是' : '否' || '暂无' }}
                      </td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">回执图片</td>
                      <td class="padNone" colspan="5" style="padding: 15px">
                        <block v-for="item in policeCheckUnqualifiedInfoReview.receiptImageInfoList" :key="item.path">
                          <img :src="`${imgPrefix + item.path}`" alt="" class="proofImg cusImg" />
                        </block>
                      </td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">回执文字</td>
                      <td class="padNone" colspan="5">
                        {{ policeCheckUnqualifiedInfoReview.receiptContent || '暂无' }}
                      </td>
                    </tr>
                  </table>
                </div>
              </div>
            </div>

            <!-- 复查信息 （合格） -->
            <div class="stepTable" v-if="params.checkResult == 1">
              <div class="actualUnitDetails">
                <div class="companyinfo">
                  <table>
                    <tr>
                      <td class="td_title" colspan="1">检查民警</td>
                      <td class="padNone" colspan="1">{{ policeCheckTaskInfoReview.policeUserName || '暂无' }}</td>
                      <td class="td_title" rowspan="5" colspan="1">民警签到图</td>
                      <td rowspan="5" width="340">
                        <img
                          :src="`${imgPrefix + policeCheckTaskInfoReview.signPicture}`"
                          alt=""
                          class="signImage cusImg"
                        />
                      </td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">警号</td>
                      <td class="padNone" colspan="1">{{ policeCheckTaskInfoReview.policeUserNo || '暂无' }}</td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">检查类型</td>
                      <td class="padNone" colspan="1">{{ policeCheckTaskInfoReview.industryExamineName || '暂无' }}</td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">检查/复查</td>
                      <td class="padNone" colspan="1">
                        {{ policeCheckTaskInfoReview.checkType == 1 ? '检查' : '复查' || '暂无' }}
                      </td>
                    </tr>
                    <tr>
                      <td class="td_title" colspan="1">检查时间</td>
                      <td class="padNone" colspan="1">{{ policeCheckTaskInfoReview.checkTime || '暂无' }}</td>
                    </tr>
                    <tr>
                      <td class="td_title" rowspan="1" colspan="1">检查结果</td>
                      <td class="padNone" colspan="1">{{ policeCheckTaskInfoReview.checkResultName || '暂无' }}</td>
                      <td class="td_title" rowspan="1" colspan="1">责任人签名</td>
                      <td colspan="1" width="340">
                        <img
                          :src="`${imgPrefix + policeCheckTaskInfoReview.principalSignatureUrl}`"
                          alt=""
                          class="dutyImage"
                        />
                      </td>
                    </tr>
                  </table>
                </div>
              </div>
            </div>
          </block>
        </div>
      </div>
    </div>

    <!-- 电子文书 附件1  检查-->
    <div style="page-break-after: always"></div>
    <div
      class="matterList page attachment"
      v-if="
        (crmBook == 'all' && params.checkType == 1) ||
        (crmBook == 'all' && params.checkType == 2 && params.checkResult == 1) ||
        (crmBook == 'all' && params.checkType == 2 && params.checkResult == 2) ||
        (crmBook == 'only' && ownType == 1 && params.checkType == 1) ||
        (crmBook == 'only' && ownType == 2 && params.checkType != 2) ||
        (crmBook == 'only' && ownType == 1 && params.checkType == 2)
      "
    >
      <div class="recordTable">
        <div class="details-table detailModal">
          <div class="right-title">{{ basePoliceInfo.policeAgencyName }}</div>
          <div class="accessory_title">附件1</div>
          <div class="books-content">
            <div class="books-topic">
              <div>
                {{ basePoliceInfo.policeAgencyName }}
              </div>
              <div>责令整改通知书</div>
              <div>
                {{ areaPoliceInfo.postShopName }}行罚决字 【{{ fullYear }}】
                {{ policeCheckUnqualifiedInfoBook.orderNo }}号
              </div>
            </div>

            <div class="books-article">
              <div class="artTwo">
                <span class="article-title">违法行为人</span>
                <span class="article-con">
                  {{ companyInfo.companyName }},地址{{ companyInfo.addressDetail }}，法定代表人{{
                    legalInfo.legalPersonName
                  }},{{ legalInfo.sex == 1 ? '男' : '女' }},{{
                    formatters(legalInfo.birth, 'wordDay')
                  }}出生,身份证号码为{{ legalInfo.idCard }}。
                </span>
              </div>

              <div class="artTwo">
                <span class="article-title">现查明</span>
                <span class="article-con">
                  {{ formatters(policeCheckTaskInfoBook.checkTime, 'wordTime') }},{{
                    areaPoliceInfo.policeAgencyName
                  }}
                  治安大队对{{ basePoliceInfo.policeAgencyName }}辖区{{ companyInfo.companyName }}检查时,发现该场所存在:
                  <block v-for="(rlist, i) in descriptionOfViolationInfoList" :key="i">
                    {{ rlist.descriptionOfViolation }}
                    <block
                      v-if="
                        descriptionOfViolationInfoList.length >= 2 && i + 1 != descriptionOfViolationInfoList.length
                      "
                    >
                      ;
                    </block> </block
                  >的违法行为。
                </span>
                <!-- 。 -->
              </div>

              <div class="artTwo">
                <!-- 写死 -->
                <span class="article-title">以上事实有</span>
                <span class="article-con"> 违法行为人供述和辩解、证人证言、书证、物证、试听资料笔录 </span>
                <span class="article-title">等证据证实。</span>
              </div>

              <div class="artTwo">
                <span class="article-title">根据</span>
                <span class="article-con">
                  <block v-for="(rlist, i) in regulationsInfoList" :key="i">
                    《{{ rlist.regulationsName }}》中
                    <block v-for="(rlistItem, index) in rlist.regulationsArticleInfoList" :key="index">
                      {{ rlistItem.regulationsArticleNo }}
                      <block v-if="rlist.regulationsArticleInfoList.length > index + 1"> 、 </block>
                    </block>
                  </block>
                </span>
                <span class="article-title">之规定。现决定</span>
                <span class="article-con">
                  给予{{ companyInfo.companyName
                  }}{{ policeCheckUnqualifiedInfoBook.rectificationType == 1 ? '限期整改' : '停业整顿' }}的行政处罚
                  <block v-if="policeCheckUnqualifiedInfoBook.isFined">
                    并处罚款{{ policeCheckUnqualifiedInfoBook.finedMoney }}元。
                  </block>
                  <block v-else>。</block>
                </span>
              </div>

              <div class="artTwo">
                <span class="article-title">执行方式和期限</span>
                <span class="article-con">
                  限你({{ companyInfo.companyName }} )于{{
                    formatters(policeCheckUnqualifiedInfoBook.penaltyEndTime, 'wordDay')
                  }}前完成以上处罚决定。
                </span>
              </div>

              <!-- <div class="artTwo">  不要删
                <span class="article-title"> 如不服本决定，可以在收到本决定书之日起六十日内向 </span>
                <span class="article-con">
                  {{ governmentName }}
                </span>
                <span class="article-title">申请行政复议或者在六个月依法向</span>
                <span class="article-con">
                  {{ courtName }}
                </span>
                <span class="article-title">提起行政诉讼。</span>
              </div> -->
              <div class="artTwo">
                <span class="article-title">责令整改通知书已向我宣告并送达。</span>
              </div>

              <div class="seal-person">
                <div class="artTwo">
                  <span class="article-title"> 被处罚人:{{ legalInfo.legalPersonName }} </span>
                </div>

                <div class="stampTime">
                  <img :src="imgPrefix + basePoliceInfo.electronicSignature" mode="" />
                  <div class="poView">
                    <div style="margin-bottom: 10px">{{ basePoliceInfo.policeAgencyName }}</div>
                    <div>{{ formatters(policeCheckTaskInfoBook.checkTime, 'wordDay') }}</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="attachAft"></div>

    <!-- 电子文书 附件2  复查-->
    <div style="page-break-after: always"></div>
    <div
      class="matterList page attachment"
      v-if="
        (crmBook == 'all' && params.checkType == 2 && params.checkResult == 2) ||
        (crmBook == 'only' && ownType == 2 && params.checkType != 1 && params.checkResult == 2) ||
        (crmBook == 'only' && ownType == 2 && params.checkType != 1)
      "
    >
      <div class="recordTable">
        <div class="details-table detailModal">
          <div class="right-title">{{ basePoliceInfo.policeAgencyName }}</div>
          <div class="accessory_title">附件2</div>
          <div class="books-content">
            <div class="books-topic">
              <div>
                {{ basePoliceInfo.policeAgencyName }}
              </div>
              <div>责令整改通知书</div>
              <div>
                {{ areaPoliceInfoReview.postShopName }}行罚决字 【{{ fullYear }}】
                {{ policeCheckUnqualifiedInfoBookReview.orderNo }}号
              </div>
            </div>

            <div class="books-article">
              <div class="artTwo">
                <span class="article-title">违法行为人</span>
                <span class="article-con">
                  {{ companyInfoReview.companyName }},地址{{ companyInfoReview.addressDetail }}，法定代表人{{
                    legalInfoReview.legalPersonName
                  }},{{ legalInfoReview.sex == 1 ? '男' : '女' }},{{
                    formatters(legalInfoReview.birth, 'wordDay')
                  }}出生,身份证号码为{{ legalInfoReview.idCard }}。
                </span>
              </div>

              <div class="artTwo">
                <span class="article-title">{{ formatters(policeCheckTaskInfoBook.checkTime, 'wordTime') }}</span>
                <span class="article-con">
                  {{ areaPoliceInfoReview.policeAgencyName }}治安大队对{{ basePoliceInfoReview.policeAgencyName }}辖区{{
                    companyInfoReview.companyName
                  }}检查时,发现该场所存在:
                  <block v-for="(rlist, i) in descriptionOfViolationInfoList" :key="i">
                    {{ rlist.descriptionOfViolation }}
                    <block
                      v-if="
                        descriptionOfViolationInfoList.length >= 2 && i + 1 != descriptionOfViolationInfoList.length
                      "
                    >
                      ;
                    </block>
                  </block>
                </span>
                <!-- 。 -->
                <span class="article-title">
                  的违法行为。经{{ formatters(policeCheckTaskInfoBookReview.checkTime, 'wordTime') }}复查,
                </span>
                <span class="article-con">
                  发现该场所仍然存在:
                  <block v-for="(rlist, i) in descriptionOfViolationInfoListReview" :key="i">
                    {{ rlist.descriptionOfViolation }}
                    <block
                      v-if="policeCheckTaskInfoBookReview.length >= 2 && i + 1 != policeCheckTaskInfoBookReview.length"
                    >
                      ;
                    </block>
                  </block>
                  的违法行为。
                </span>
                <span class="article-title">故对该场所做出</span>
                <span class="article-con">
                  {{ policeCheckTaskInfoBookReview.rectificationType == 1 ? '限期整改' : '停业整顿' }}
                </span>
                <span class="article-title">的行政处罚。</span>
              </div>

              <div class="artTwo">
                <!-- 写死 -->
                <span class="article-title">以上事实有</span>
                <span class="article-con"> 违法行为人供述和辩解、证人证言、书证、物证、试听资料笔录 </span>
                <span class="article-title">等证据证实。</span>
              </div>

              <div class="artTwo">
                <span class="article-title">执行方式和期限</span>
                <span class="article-con">
                  限你({{ companyInfoReview.companyName }} )于{{
                    formatters(policeCheckUnqualifiedInfoBookReview.penaltyEndTime, 'wordDay')
                  }}前完成以上处罚决定。
                </span>
              </div>

              <!-- <div class="artTwo">   不要删
                <span class="article-title"> 如不服本决定，可以在收到本决定书之日起六十日内向 </span>
                <span class="article-con">
                  {{ governmentNameReview }}
                </span>
                <span class="article-title">申请行政复议或者在六个月依法向</span>
                <span class="article-con">
                  {{ courtNameReview }}
                </span>
                <span class="article-title">提起行政诉讼。</span>
              </div> -->

              <div class="artTwo">
                <span class="article-title">责令整改通知书已向我宣告并送达。</span>
              </div>

              <div class="seal-person">
                <div class="artTwo">
                  <span class="article-title"> 被处罚人:{{ legalInfoReview.legalPersonName }} </span>
                </div>

                <div class="stampTime">
                  <img :src="imgPrefix + basePoliceInfo.electronicSignature" mode="" />
                  <div class="poView">
                    <!-- areaPoliceInfoReview.policeAgencyName  -->
                    <div style="margin-bottom: 10px">{{ basePoliceInfo.policeAgencyName }}</div>
                    <div>{{ formatters(policeCheckTaskInfoBookReview.checkTime, 'wordDay') }}</div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="attachAft"></div>
  </div>
</template>

<script>
import { checkTaskRecord, electronicRecords } from '@/api/goover'
import { findEnableDictItemsbyCode } from '@/api/api'
import { formatters, formattersWord } from '@/utils/util.js'
import { addHtmlStyleProps, removeHtmlStyleProps } from '../../../utils/util'

export default {
  name: 'belowthemarkPdf',
  data() {
    return {
      records: {},
      fullYear: new Date().getFullYear(),
      params: {},
      policeCheckTaskInfo: {},
      policeCheckUnqualifiedInfo: {},
      policeCheckDetailInfoList: {},
      policeCheckCategoryInfoList: {},
      crmBook: null, // 是否只看电子文书
      ownType: null, // 电子文书类型  且只看电子文书
      // 复查单
      policeCheckTaskInfoReview: {},
      policeCheckCategoryInfoListReview: {},
      policeCheckUnqualifiedInfoReview: {},
      // 检查 电子文书
      areaPoliceInfo: {},
      basePoliceInfo: {},
      companyInfo: {},
      courtName: '',
      governmentName: '',
      informationInfo: {},
      legalInfo: {},
      policeCheckTaskInfoBook: {},
      policeCheckUnqualifiedInfoBook: {},
      regulationsInfoList: {},
      descriptionOfViolationInfoList: {},
      //复查 电子文书
      areaPoliceInfoReview: {},
      basePoliceInfoReview: {},
      companyInfoReview: {},
      courtNameReview: '',
      governmentNameReview: '',
      informationInfoReview: {},
      legalInfoReview: {},
      policeCheckTaskInfoBookReview: {},
      policeCheckUnqualifiedInfoBookReview: {},
      regulationsInfoListReview: {},
      descriptionOfViolationInfoListReview: {},
      imgPrefix: '',
    }
  },
  created() {
    this.getImagePrefix()
  },
  mounted() {
    addHtmlStyleProps()
    document.getElementsByClassName('ant-layout-header')[0].style.display = 'none'
    if (document.getElementsByClassName('ant-layout-footer')[0]) {
      document.getElementsByClassName('ant-layout-footer')[0].style.display = 'none'
    }

    this.params = {}

    if (this.$route.query.records && typeof this.$route.query.records === 'object') {
      this.params = this.$route.query.records
      localStorage.setItem('detailsGooverData', JSON.stringify(this.params)) // 持久化储存 刷新使用
    } else {
      this.params = JSON.parse(localStorage.getItem('detailsGooverData'))
    }

    this.crmBook = sessionStorage.getItem('crmBook')
    this.ownType = sessionStorage.getItem('ownType') //单号类型：检查单/复查单  1/2

    //检查（不合格）
    if (this.params.checkType == 1) {
      this.checkList()
      return
    }

    this.getDetailList()
  },
  methods: {
    formatters,
    formattersWord,
    htmlToPdf() {
      document.head.getElementsByTagName('title')[0].innerText =
        this.policeCheckTaskInfo.companyMessageName + '检查记录单'

      var firstHeight = document.getElementsByClassName('attachment')[0].offsetHeight

      //checkType  1： 检查单  2：复查单
      //checkResult  1： 合格  2：不合格
      if (this.params.checkType == 2 && this.params.checkResult == 1) {
        // 复查单 合格
        document.getElementsByClassName('attachment')[0].style.height = firstHeight + 1000 + 'px'
      }

      if (this.params.checkType == 2 && this.params.checkResult == 2) {
        // 复查单 不合格
        document.getElementsByClassName('attachment')[0].style.height = firstHeight + 550 + 'px'
      }
      document.getElementsByClassName('attachment')[0].style.paddingRight = 25 + 'px'
      document.getElementsByClassName('attachAft')[0].style.marginBottom = firstHeight - 30 + 'px'

      if (this.params.checkType == 1 && this.params.checkResult == 2) {
        // 检查单 不合格
        if (this.policeCheckCategoryInfoList.length > 1) {
          // 不合格项 > 1
          document.getElementsByClassName('attachment')[0].style.height = firstHeight * 2 + 1000 + 'px'
        } else {
          document.getElementsByClassName('attachment')[0].style.height = firstHeight + 200 + 'px'
        }
        document.getElementsByClassName('attachAft')[0].style.marginBottom = 0 + 'px'
      }

      if (this.areaPoliceInfoReview.policeAgencyName) {
        document.getElementsByClassName('attachAft')[0].style.marginBottom = 0 + 'px'

        var secondHeight = document.getElementsByClassName('attachment')[1].offsetHeight

        if (this.policeCheckCategoryInfoListReview.length > 1) {
          // 复查不合格项 > 1
          document.getElementsByClassName('attachment')[1].style.height = secondHeight * 2 + 1000 + 'px'
        } else {
          document.getElementsByClassName('attachment')[1].style.height = secondHeight + 1000 + 'px'
        }
        document.getElementsByClassName('attachment')[1].style.paddingRight = 25 + 'px'
        // document.getElementsByClassName('attachAft')[1].style.marginBottom = firstHeight - 30 + 'px'
      }

      window.print()
      window.location.reload()
    },
    checkList() {
      checkTaskRecord({ taskId: this.params.id })
        .then((res) => {
          let {
            policeCheckTaskInfo,
            policeCheckUnqualifiedInfo,
            policeCheckDetailInfoList,
            policeCheckCategoryInfoList,
          } = res.result
          this.policeCheckTaskInfo = policeCheckTaskInfo

          this.policeCheckUnqualifiedInfo = policeCheckUnqualifiedInfo
          this.policeCheckDetailInfoList = policeCheckDetailInfoList
          // this.policeCheckCategoryInfoList = policeCheckCategoryInfoList
          this.policeCheckCategoryInfoList = this.infoCheck(policeCheckCategoryInfoList)
          return this.policeCheckUnqualifiedInfo.id
        })
        .then((res2) => {
          this.crpBookList(res2)
        })
    },
    getDetailList() {
      // 检查单
      checkTaskRecord({ taskId: this.params.policeCheckTaskId })
        .then((res) => {
          let { policeCheckTaskInfo, policeCheckUnqualifiedInfo, policeCheckCategoryInfoList } = res.result
          this.policeCheckTaskInfo = policeCheckTaskInfo
          this.policeCheckUnqualifiedInfo = policeCheckUnqualifiedInfo
          // this.policeCheckCategoryInfoList = policeCheckCategoryInfoList
          this.policeCheckCategoryInfoList = this.infoCheck(policeCheckCategoryInfoList)
          return this.policeCheckUnqualifiedInfo.id
        })
        .then((res2) => {
          this.crpBookList(res2)
        })

      // 复查单
      checkTaskRecord({ taskId: this.params.id })
        .then((res) => {
          let { policeCheckTaskInfo, policeCheckCategoryInfoList, policeCheckUnqualifiedInfo } = res.result
          this.policeCheckTaskInfoReview = policeCheckTaskInfo
          // this.policeCheckCategoryInfoListReview = policeCheckCategoryInfoList
          this.policeCheckCategoryInfoListReview = this.infoCheck(policeCheckCategoryInfoList)
          this.policeCheckUnqualifiedInfoReview = policeCheckUnqualifiedInfo

          return this.policeCheckUnqualifiedInfoReview.id
        })
        .then((res2) => {
          if (this.params.checkResult == 2) {
            this.crpBookList2(res2)
          }
        })
    },
    // 不合格项  排序
    infoCheck(infoList) {
      let num = 1
      for (var i = 0; i < infoList.length; i++) {
        for (var j = 0; j < infoList[i].policeCheckDetailInfoList.length; j++) {
          infoList[i].policeCheckDetailInfoList[j].frontNum = num++
        }
      }

      return infoList
    },
    // 检查单 电子文书
    crpBookList(res2) {
      electronicRecords(res2).then((resBook) => {
        let {
          areaPoliceInfo,
          basePoliceInfo,
          companyInfo,
          courtName,
          governmentName,
          informationInfo,
          legalInfo,
          policeCheckTaskInfo,
          policeCheckUnqualifiedInfo,
          regulationsInfoList,
          descriptionOfViolationInfoList,
        } = resBook.result || {}
        this.areaPoliceInfo = areaPoliceInfo
        this.basePoliceInfo = basePoliceInfo
        this.companyInfo = companyInfo
        this.courtName = courtName
        this.governmentName = governmentName
        this.informationInfo = informationInfo
        this.legalInfo = legalInfo
        this.policeCheckTaskInfoBook = policeCheckTaskInfo
        this.policeCheckUnqualifiedInfoBook = policeCheckUnqualifiedInfo
        this.regulationsInfoList = regulationsInfoList
        this.descriptionOfViolationInfoList = descriptionOfViolationInfoList
      })
    },
    // 复查单 电子文书
    crpBookList2(res2) {
      electronicRecords(res2).then((resBook) => {
        let {
          areaPoliceInfo,
          basePoliceInfo,
          companyInfo,
          courtName,
          governmentName,
          informationInfo,
          legalInfo,
          policeCheckTaskInfo,
          policeCheckUnqualifiedInfo,
          regulationsInfoList,
          descriptionOfViolationInfoList,
        } = resBook.result || {}
        this.areaPoliceInfoReview = areaPoliceInfo
        this.basePoliceInfoReview = basePoliceInfo
        this.companyInfoReview = companyInfo
        this.courtNameReview = courtName
        this.governmentNameReview = governmentName
        this.informationInfoReview = informationInfo
        this.legalInfoReview = legalInfo
        this.policeCheckTaskInfoBookReview = policeCheckTaskInfo
        this.policeCheckUnqualifiedInfoBookReview = policeCheckUnqualifiedInfo
        this.regulationsInfoListReview = regulationsInfoList
        this.descriptionOfViolationInfoListReview = descriptionOfViolationInfoList
      })
    },
    getImagePrefix() {
      findEnableDictItemsbyCode({ code: 'static_server' }).then((res) => {
        this.imgPrefix = res.result[0].value
      })
    },
  },
  destroyed() {
    removeHtmlStyleProps()

    document.getElementsByClassName('ant-layout-header')[0].style.display = 'block'
    document.getElementsByClassName('ant-layout-footer')[0].style.display = 'block'
  },
}
</script>

<style scoped lang="less" scoped>
.inspectPdf {
  padding-bottom: 15px;

  .accessory_title {
    margin: 10px 0;
    color: #9b9b9b;
  }

  .books-content {
    padding: 15px;
    border: 1px solid #830707;

    .books-topic {
      color: #9e520a;
      text-align: center;
      font-weight: 500;
      line-height: 50px;

      div:nth-of-type(1) {
        font-size: 24px;
      }

      div:nth-of-type(2) {
        font-size: 40px;
        font-weight: 700;
      }

      div:nth-of-type(3) {
        color: #232222;
        font-size: 14px;
        text-align: right;
      }
    }

    .books-article {
      padding: 0 10px;
      color: #848484;
      font-size: 16px;
      font-weight: 500;

      .artTwo {
        text-indent: 2em;
        line-height: 30px;
        .article-title {
          color: #000000;
          font-size: 16px;
        }

        .article-con {
          padding-bottom: 2px;
          border-bottom: 1px solid #830707;
        }
      }

      .seal-time {
        position: relative;
        padding-top: 2vh;
        text-align: right;
        font-size: 18px;
        color: #232222;
        line-height: 50px;

        .seal-date {
          position: absolute;
          display: inline-block;
          right: 10px;
          top: 45px;
        }

        .seal-image {
          width: 150px;
          height: 150px;
        }
      }

      .seal-person {
        display: flex;
        justify-content: space-between;
        position: relative;

        .stampTime {
          min-width: 220px;
          max-width: 700px;
          text-align: right;
          img {
            width: 150px;
            height: 150px;
          }

          .poView {
            position: absolute;
            top: 5px;
            right: 0;
            .poName {
              color: #000000;
              font-size: 24px;
            }
          }
        }
      }
    }
  }

  .cusImg {
    object-fit: cover;
  }
}

table {
  // border: 1px !important;
  tr {
    page-break-inside: avoid;
  }
}
.attachment {
  page-break-inside: avoid;
}
</style>
